<?php
/**
 * Created by PhpStorm.
 * User: lenvo
 * Date: 2018/5/29
 * Time: 22:57
 */
namespace app\common\taglib;
use think\template\TagLib;

class Auth extends TagLib
{
    protected $tags = [
        'button' => ['attr' => 'rules,rule','close' => 1]
    ];

    public function tagButton($tag, $content) {
        $rules = $tag['rules'];
        $rule = $tag['rule'];
        return "<?php if(in_array('{$rule}',{$rules})){ ?>".$content."<?php } ?>";
    }
}